package com.starleague.battletech.unit.mech.jpa.appengine;

import com.starleague.battletech.BattletechException;
import com.starleague.battletech.unit.BattletechUnitInternalStructureType;
import com.starleague.battletech.unit.IWeight;
import com.starleague.battletech.unit.mech.AbstractMechInternalStructureFactory;
import com.starleague.battletech.unit.mech.IMutableMech;

public class MechInternalStructureGaeFactory
        extends AbstractMechInternalStructureFactory
{
    @Override
    public MechInternalStructureGae addInternalStructure(IMutableMech mech,
                                                         IWeight internalStructureWeight,
                                                         BattletechUnitInternalStructureType internalStructureType)
            throws BattletechException
    {
        MechInternalStructureGae internalStructure = new MechInternalStructureGae((MechGae) mech,
                                                                                  internalStructureWeight,
                                                                                  internalStructureType);
        ((MechGae) mech).setInternalStructure(internalStructure);
        return internalStructure;
    }
}
